<?php
namespace app\api\controller;

use AlibabaCloud\SDK\OSS\OSS\PutBucketWebsiteRequest\body\websiteConfiguration\routingRules\routingRule\redirect\mirrorHeaders\set;
use app\api\controller\Sample;
use app\common\controller\ApiController;
use think\App;
use \app\admin\traits\Curd;
use think\facade\Db;
use app\api\controller\Adv;
use app\api\model\User as ModelUser;
use PhpOffice\PhpSpreadsheet\Reader\Xls\MD5;
use Easemob\Auth;
use Easemob\Block;
use Easemob\Group;
use Easemob\Message;
use Easemob\User;

class Chathuanxin extends ApiController
{
    protected $noNeedLogin = [
        "test",
    ];
    protected $mustLogin = [];
    protected $counter = 0;

    use \app\admin\traits\Curd;
    public function __construct(App $app)
    {
        parent::__construct($app);
    }
    
    public function test(){
        $auth = new Auth("1105201105148640#demo", "YXA67Y7RlN_JQvyUr7ql3aPgYA", "YXA6fuTrKOjAu-SLWMTUpOqfYvEBf7s");
        $user = new User($auth);
        $Block = new Block($auth);
        $Group = new Group($auth);
        $message = new Message($auth);

        // 注册单个用户
        // $data = array(
        //     'username' => 'zs',
        //     'password' => '123123',
        //     'nickname' => 'users',
        // );
        // $res =  $user->create($data);

        $token = $auth->getUserToken("zs", "123123");
        $headers = $auth->headers("zs", "123123");

        //环信即时通讯 IM 分配的用于访问 RESTful API 的域名
        $getRemoteApiUri = $auth->getApiUri();
        
   
       $res = $message->text("users",['zs'],["msg"=>"你不好sdaaaasdasd"]);
       dump($res);die;
        
 

    }























     

     

    
 
   
}
